<?php

Route::get('/login', '\App\Admin\Controllers\LoginController@index');
Route::post('/login', '\App\Admin\Controllers\LoginController@login');
Route::get('/logout', '\App\Admin\Controllers\LoginController@logout');

Route::get('/test', '\App\Admin\Controllers\HomeController@test');

Route::group(['middleware' => 'auth:admin'], function() {
	//首页
	Route::get('/home', '\App\Admin\Controllers\HomeController@index');
	//管理人员模块
	Route::get('/users', '\App\Admin\Controllers\UserController@index');
	Route::get('/users/add', '\App\Admin\Controllers\UserController@add');
	Route::post('/users/store', '\App\Admin\Controllers\UserController@store');
	Route::get('/users/{user}/role', '\App\Admin\Controllers\UserController@role');
	Route::post('/users/{user}/role', '\App\Admin\Controllers\UserController@storeRole');

	//角色
	Route::get('/roles', '\App\Admin\Controllers\RoleController@index');
	Route::get('/roles/create', '\App\Admin\Controllers\RoleController@create');
	Route::post('/roles/store', '\App\Admin\Controllers\RoleController@store');
	Route::get('/roles/{role}/permission', '\App\Admin\Controllers\RoleController@permission');
	Route::post('/roles/storePermission', '\App\Admin\Controllers\RoleController@storePermission');

	//权限模块
	Route::get('/permissions', '\App\Admin\Controllers\PermissionController@index');
	Route::get('/permissions/create', '\App\Admin\Controllers\PermissionController@create');
	Route::post('/permissions/store', '\App\Admin\Controllers\PermissionController@store');

	//审核模块
	Route::get('/posts', '\App\Admin\Controllers\PostController@index');
	Route::post('/posts/{post}/status', '\App\Admin\Controllers\PostController@status');
});


